#!/usr/bin/python

from random import random


def main():
    of = open('data', 'w')

    # make data
    data_1 = [x * 0.01 for x in range(0,1000)]
    data_2 = [x * 0.01 for x in range(0,1000)] # require len is same as data_1
    #noise = [(2.0*random() - 1.0) for i in range(0, len(data_1))]
    #data_0 = [data_1[i] + noise[i] for i in range(0, len(data_1))]
    #noise = [(2.0*random() - 1.0) for i in range(0, len(data_1))]
    #data_1 = [data_2[i] + noise[i] for i in range(0, len(data_1))]
    noise = [(2.0*random() - 1.0) for i in range(0, len(data_1))]
    ys = [(5 *  data_1[i] + 2 * data_2[i] + 4 * noise[i]) 
          for i in range(0, len(data_1))]

    # write data
    of.write('# ' + str(len(data_1)) + '\n')
    of.write('# ' + str(2) + '\n')
    for i in range(0, len(data_1)):
        of.write('%f 1:%f 2:%f\n' % (ys[i], data_1[i], data_2[i]))

    of.close()

if __name__ == "__main__":
    main()
